import $http from '@/config/requestConfig.js'

export const wechat = {
	wxLogin({ code, mode }) {
		return $http.post(
			'wechat/login', 
			{ code, mode: mode || 'xcx' },
			{ isDomain: false, isAuth: false },
		)
	},
	getJsConfig({ url }) {
		return $http.post(
			'wechat/jsconfig',
			{ url },
			{ isDomain: false, isAuth: false }
		)
	},
	bindPhone({ openid, iv, encrypted_data }) {
		return 	$http.post(
			'wechat/bind/phone',
			 { openid, iv, encrypted_data, mode: 'xcx'},
			 { isDomain: false, isAuth: false }
		)
	}
}
